package com.tmxk.days01.carrental_wmh;

/**
 * 汽车业务类(MotoOperation)主要是租赁业务
 * @author Administrator
 *
 */
public class MotoOperation {
    MotoVehicle[] motoVehicles  = new MotoVehicle[12];
    /**
     * 多态体现 : 父类引用作为方法返回值类型
     * 初始化机动车信息
     */
    public MotoVehicle[] initMotoVehicle(){
        // 1. 初始化四条 轿车信息对象
        // 多态： 父类对象指向子类具体实例
        motoVehicles[0] = new Car("京NY28588", "宝马", 800, "X6");
        motoVehicles[1] = new Car("京CNY3284", "宝马", 600, "550i");
        motoVehicles[2] = new Car("京NT37465", "别克", 300, "林荫大道");
        motoVehicles[3] = new Car("京NT96968", "别克", 600, "GL8");
        // 2. 初始化四条 客车信息对象
        motoVehicles[4] = new Bus("京6566754", "金杯", 800, "16座");
        motoVehicles[5] = new Bus("京8696997", "金龙", 800, "16座");
        motoVehicles[6] = new Bus("京9696996", "金杯", 1500, "34座");
        motoVehicles[7] = new Bus("京8696998", "金龙", 1500, "34座");
        // 3. 初始化四条 卡车信息对象
        motoVehicles[8] = new Truck("京MH98725", "一汽解放", 50, "1吨");
        motoVehicles[9] = new Truck("京3216L59", "重庆红岩", 50, "1吨");
        motoVehicles[10] = new Truck("京NU98631", "一汽解放", 100, "2吨");
        motoVehicles[11] = new Truck("京CY56312", "重庆红岩", 100, "2吨");
        return motoVehicles;

    }
}
